package com.luhai.shipmentscheck.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.luhai.shipmentscheck.R;

import java.util.List;

/**
 * Created by jzh-创世头盔之父.
 * Date: 2019\10\23 0023* Time: 13:31
 * Emaile: 1186832904@qq.com
 * Introduction: jzh de code
 */
public class ClIdAdapter extends BaseAdapter {

    private List<String> list;

    private Context mContext;

    private LayoutInflater layoutInflater;

    public ClIdAdapter(List<String> list, Context mContext) {
        this.list = list;
        this.mContext = mContext;
        layoutInflater = LayoutInflater.from(mContext);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View view, ViewGroup parent) {
        Holder holder;
        if (view == null) {
            view = layoutInflater.inflate(R.layout.item_clid_list, null);
            holder = new Holder(view);
            view.setTag(holder);
        } else {
            holder = (Holder) view.getTag();
        }
        holder.tv_cl_id.setText(list.get(position));
        return view;
    }

    class Holder {

        TextView tv_cl_id;

        public Holder(View view) {
            this.tv_cl_id = view.findViewById(R.id.tv_cl_id);
        }
    }
}
